from rest_framework.pagination import PageNumberPagination


class LargeResultsSetPagination(PageNumberPagination):

    # 默认页面展示的条数
    page_size = 3
    # 前端访问url需要添加 ?page=页码
    page_query_param = 'page'
    # 用户自定义返回的条数，格式?page_size=页数
    page_size_query_param = "pagesize"
    # 用户自定义返回的条数最大限制，数值超过5也只展示5条
    max_page_size = 5



class StandardResultsSetPagination(PageNumberPagination):
    page_size = 10
    page_size_query_param = 'pagesize'
    max_page_size = 10